<?php

function getCategory($catData, $prentsID= 0, $space = "&nbsp;") {
//            $catList = "<ul>";
    foreach ($catData as $aCat) {
        if ($aCat['category_parent'] == $prentsID) {
            $catList .= "<option value=".$aCat['category_id'].">" . $space . $aCat['category_name'] . "</option>";
            $catList .= getCategory($catData, $aCat['category_id'], $space . "&nbsp;&nbsp;&nbsp;");
        }
    }
//            $catList .= "</ul>";
    return $catList;
}

$catList = getCategory($aryCategory);
//        echo $catList;
?>

<select name="product_category_id" id="product_category_id" class="w200p" onchange="AdminController.selectSubCat();">
    <option value="">Chọn danh mục sản phẩm</option>
    <?php echo $catList; ?>
</select>